package com.dongjiubigstone.networkmonitor.service.impl;

import com.dongjiubigstone.networkmonitor.dao.PersonDao;
import com.dongjiubigstone.networkmonitor.po.Person;
import com.dongjiubigstone.networkmonitor.service.PersonService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 人serviceimpl
 *
 * @author merlynr
 * @className: PersonServiceimpl
 * @description: ren
 * @author: Merlynr
 * @date: 11/17/2020
 * @date 2020/11/17
 */
@Component
public class PersonServiceImpl implements PersonService {

    private final Logger logger = Logger.getLogger(getClass());

    @Autowired
    private PersonDao personDao;


    /**
     * 通过id获取一个
     *
     * @param id id
     * @return {@link Person}
     */
    public Person getOneById(int id) {
        logger.info(id);
        logger.info(personDao.selectByPrimaryKey(id));

        return personDao.selectByPrimaryKey(id);
    }
}
